home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
626-637
/
disk_629
/
apig
/
apig31.lzh
/
newscreen0.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-03-11
|
3KB
|
146 lines
/* Example of OPENSCREENTAGLIST/OPENWINDOWTAGLIST */
call addlib("apig.library",0,-30,0)
call set_apig_globals()
scrtaglist = makescrtaglist() /* build tag list for screen */
scr = OPENSCREENTAGLIST(null(),scrtaglist)
say scrprocname(scr)
call openwin()
say CLOSESCREEN(scr)
call FREETAGITEMS(scrtaglist)
exit
/* ------------------------------------------------------------ */
openwin:
portname = "scrtagsport"
p = openport(portname)
wintitle = "APIG v3.1 Screen/Window TagList Example"
wintaglist = makewintaglist() /* build tag list for window */
win = openwindowtaglist(portname,null(),wintaglist)
exitme = 0
do while exitme = 0
call waitpkt(portname)
do forever
msg = '0000 0000'x
msg = getpkt(portname)
if msg = '0000 0000'x then leave
class = getarg(msg,0)
x = reply(msg,0)
if class = IDCMP_CLOSEWINDOW then exitme = 1
end
end
call CLOSEWINDOW(win)
call FREETAGITEMS(wintaglist)
call FREEVEC(mytitle)
return 1
/* ------------------------------------------------------------ */
makewintaglist:
winidcmp = IDCMP_CLOSEWINDOW
winflags = WFLG_CLOSEGADGET + WFLG_DRAGBAR + WFLG_SIZEGADGET,
+ WFLG_DEPTHGADGET + WFLG_GIMMEZEROZERO
mytaglist = ALLOCATETAGITEMS(30)
call SETTAGSLOT(mytaglist,0,WA_LEFT,'n',0)
call SETTAGSLOT(mytaglist,1,WA_TOP,'n',0)
call SETTAGSLOT(mytaglist,2,WA_WIDTH,'n',640)
call SETTAGSLOT(mytaglist,3,WA_HEIGHT,'n',200)
call SETTAGSLOT(mytaglist,4,WA_DETAILPEN,'n',3)
call SETTAGSLOT(mytaglist,5,WA_BLOCKPEN,'n',4)
call SETTAGSLOT(mytaglist,6,WA_MINWIDTH,'n',40)
call SETTAGSLOT(mytaglist,7,WA_MAXWIDTH,'n',640)
call SETTAGSLOT(mytaglist,8,WA_MINHEIGHT,'n',80)
call SETTAGSLOT(mytaglist,9,WA_MAXHEIGHT,'n',400)
call SETTAGSLOT(mytaglist,10,WA_SIZEGADGET,'n',1)
call SETTAGSLOT(mytaglist,11,WA_DRAGBAR,'n',1)
call SETTAGSLOT(mytaglist,12,WA_CLOSEGADGET,'n',1)
call SETTAGSLOT(mytaglist,13,WA_ACTIVATE,'n',1)
call SETTAGSLOT(mytaglist,14,WA_GIMMEZEROZERO,'n',1)
mytitle = ALLOCVEC(length(wintitle)+1,MEMF_CLEAR)
call export(mytitle,wintitle)
call SETTAGSLOT(mytaglist,15,WA_TITLE,'p',mytitle)
call SETTAGSLOT(mytaglist,16,WA_FLAGS,'n',winflags)
call SETTAGSLOT(mytaglist,17,WA_IDCMP,'n',winidcmp)
call SETTAGSLOT(mytaglist,18,WA_CUSTOMSCREEN,'p',scr)
call SETTAGSLOT(mytaglist,19,TAG_DONE,'n',0)
return mytaglist
/* ------------------------------------------------------------ */
makescrtaglist:
scrtagl = ALLOCATETAGITEMS(18)
sapens = MAKEPOINTER(scrtagl,0,24,MEMF_CLEAR)
call SETVALUE(sapens,0,2,'n',-1)
scrpname = MAKEPOINTER(scrtagl,0,80,MEMF_CLEAR)
call export(scrpname,"MY SCREEN ONE ")
call SETTAGSLOT(scrtagl,0,SA_Title,'p',scrpname)
call SETTAGSLOT(scrtagl,1,SA_Left,'n',0)
call SETTAGSLOT(scrtagl,2,SA_Top,'n',0)
call SETTAGSLOT(scrtagl,3,SA_Width,'n',640)
call SETTAGSLOT(scrtagl,4,SA_Height,'n',400)
call SETTAGSLOT(scrtagl,5,SA_DISPLAYID,'p','0001 9004'x) /* hires+lace */
call SETTAGSLOT(scrtagl,6,SA_PENS,'p',sapens)
call SETTAGSLOT(scrtagl,7,SA_Depth,'n',3)
call SETTAGSLOT(scrtagl,8,SA_Type,'n',CUSTOMSCREEN)
call SETTAGSLOT(scrtagl,9,TAG_DONE,'n',0)
return scrtagl